﻿@model CmsAdminSearchModel

@{
    Layout = "~/admin/Templates/TelerikAdministration.cshtml";
    ViewBag.Title = "Search";
}

<h1>You've searched for &quot;<span class="term">@Model.SearchQuery</span>&quot;</h1>
@if (Model.Results.Any())
{
    foreach (var group in Model.Results.GroupBy(e => e.SearchArea))
    {
        <h1 class="g-clear">
            <i class="b-icon b-icon_h b-icon_h_pages"></i>
            <span class="b-overflow">@group.Key</span>
        </h1>
        <ul class="b-results g-clear">
        @{ int pageNum = 0; }
        @foreach (var result in group)
        {
            <li class="b-results__item">
                <a href="@Url.RouteUrl("CmsAdminSearch_"+result.TypeParameter, new {id = result.Id})">@result.Title</a>
            </li>
            pageNum++;
            if (pageNum % 4 == 0)
            {
                <div class="clearall" ></div>
            }
        }
        </ul>
    }
}
else
{
    <h2>Sorry, no results for <span class="term">@Model.SearchQuery</span></h2>
}

